<?php
/*
 * Template Name: Home
 */
?>

<?php get_header(); ?>
<?php 
if (have_posts()) : while (have_posts()) : the_post();
	$page_content = get_the_content();
endwhile; endif;
?>

<div id="home-main" class="content main">
<div class="container12">

	<!-- Begin Main (Featured and Welcome) Content -->
	<div class="column9 outer post_page_content">
	
		
		<div class="row">
			<?php
			$featured_posts = sfc_get_featured_posts();
			//students_for_change_print_array($posts);
			
			$i = 0;
			foreach($featured_posts as $post) : setup_postdata($post); 
				$meta = get_post_custom( $post->ID );
				?>
				
				<div class="column6 feat_project <?php echo ($i == 0)? "alpha" : "omega"; ?>">
				
					<h2><a href="<?php the_permalink(); ?>">
						<?php 
							if(empty($meta['meta_team_name'][0]))
								the_title(); 
							else
								echo $meta['meta_team_name'][0];
						?>
					</a></h2>
					
					<div class="feat_topic">
						<p>Topic: <strong><?php echo $meta['meta_topic'][0]; ?></strong></p>
					</div>
					
					<div class="feat_thumb">
						<?php the_post_thumbnail(); ?>
					</div>
					
					<div class="feat_summary">
						<p><?php echo $meta['meta_summary'][0]; ?></p>
					</div>
					
				</div>
			<?php 
			$i++;
			endforeach;
			?>
			
		</div>
		
		
		<div class="row">
		
			<?php echo $page_content; ?>
			
		</div>	
			
			
			
			
		<div class="row">
			<div class="column12 metainfo"><?php edit_post_link(); ?></div>
		</div>
				
	</div>
	<!-- End Main Content -->
	
	
	
	<!-- Sidebar Content -->
	<div class="column3 omega post_page_sidebar">
		<?php get_sidebar(); ?>
	</div>
	<!-- End Sidebar Content -->
	
		
</div>
</div>
<?php get_footer(); ?>